<template>
  <div class="HomeItemT9">
    <div class="box">
      <img :src="itemData.image.url" alt="">

      <div class="desc">
        <h3>{{ itemData.summaryText }}</h3>

        <div class="houseName">{{ itemData.houseName }}</div>

        <div class="starAndPrice">
          <div class="star">
            <van-rate :model-value="Number(itemData.commentScore)" readonly allow-half void-color="#fff" />
          </div>
          <div class="price">{{ itemData.finalPrice }}元</div>
        </div>
      </div>

    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive } from 'vue'

defineProps({
  itemData: {
    type: Object,
    default: () => ({})
  }
})
</script>

<style scoped lang="less">
.box {
  position: relative;
  width: 168px;
  height: 223px;

  img {
    width: 100%;
  }

  .desc {
    position: absolute;
    bottom: 0;
    left: 0;
    color: #fff;
    text-align: center;

    h3 {
      font-size: 14px;
      font-weight: normal;
    }

    .houseName {
      padding: 0 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .starAndPrice {
      display: flex;
      justify-content: space-around;
      align-items: center;
    }
  }
}
</style>
